<?php

include("../jphpframework.php");

$dsn = array('host'=>'localhost',
			 'dbtype'=>'mysqli',
             'database'=>'jphpframework',
             'username'=>'jphpframework',
             'password'=>'jphpframework');

$db = new JDb($dsn);


$user = new JDbTable($db, 'user', 'user_id');
$user->data['username'] = 'New User'.rand(100, 999);
$user->save();

$query = "SELECT * FROM user WHERE user_id > ?";
$res =& $db->select($query, array(0));
$db->output();echo "<br />";

while($row =& $res->fetchRow()){
	echo $row['username']."<br />";
}